import hyRequest from "./index";
import type { IResultData } from "./index";
import { IAllProduct, IHomeInfo, ISearchSuggest } from "../type/homeType";

export const getSearchSuggest = () => {
  return hyRequest.get<IResultData<ISearchSuggest>>("/searchSuggest/get");
};

// 轮播图数据获取
export const getHomeInfo = () => {
  return hyRequest.get<IResultData<IHomeInfo>>("/home/info");
};

// 编辑推荐
export const getHotProduct = () => {
  return hyRequest.get<IResultData<IHomeInfo>>("/hotproduct_v2/gets");
};

// 热门商品
export const getAllProduct = () => {
  return hyRequest.get<IResultData<IHomeInfo>>("/allProduct/gets");
};
